package com.fortune.rainshine.feign.service;

import com.fortune.rainshine.config.FeignConfig;
import com.fortune.rainshinecommon.base.MsgModel;
import com.fortune.rainshinecommon.base.ParmsModel;
import com.fortune.rainshinecommon.model.service.StockModel;
import com.fortune.rainshinecommon.query.StockQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;

@FeignClient(value = "rain-shine-service",configuration = FeignConfig.class)
@Controller
public interface StockFeign {
    /**
     * 获取库存信息列表
     * @param parms
     * @return
     */
    @PostMapping("/stock/getStockList")
    @ResponseBody
    MsgModel getStockList(@RequestBody ParmsModel parms);

    /**
     * 增加/减少库存
     * @param model
     * @return
     */
    @PostMapping("/stock/purchase")
    @ResponseBody
    MsgModel purchase(@RequestBody StockModel model);

    /**
     * 获取门店的销售产品列表
     * @param query
     * @return
     */
    @PostMapping("/stock/getSaleList")
    @ResponseBody
    MsgModel getSaleList(@RequestBody StockQuery query);

    /**
     * 获取门店的领用产品列表
     * @param query
     * @return
     */
    @PostMapping("/stock/getConsumeList")
    @ResponseBody
    MsgModel getConsumeList(@RequestBody StockQuery query);

    /**
     * 获取某个门店的某一个产品的出入库详情
     * @param parms
     * @return
     */
    @RequestMapping("/stock/stockRecordDetail")
    @ResponseBody
    MsgModel stockRecordDetail(@RequestBody ParmsModel parms);
}
